import cn.hutool.core.convert.Converter;

/**
 * @Name: CustomConverter
 * @Description:
 * @Author: Mr.Tong
 */
public class CustomConverter implements Converter<YangGuo> {

    @Override
    public YangGuo convert(Object value, YangGuo defaultValue) throws IllegalArgumentException {
        // 强转
        XiaoLongNv xiaoLongNv = (XiaoLongNv) value;
        // 转换过程
        xiaoLongNv.setName("杨过");
        xiaoLongNv.setArm("断臂");
        xiaoLongNv.setGender("男");
        // 穿上杨过的皮大衣
        return new YangGuo(xiaoLongNv.getName(), xiaoLongNv.getArm(), xiaoLongNv.getGender());
    }
}
